<?
        require_once('../Inc/Global.php');
        require_once('UserManagement/UserData.php');
        require_once('AddressMgmt/AddressData.php');
        require_once('CategoriesMgmt/CategoryData.php');
        require_once('ConnectMethMgmt/ConnectData.php');
        $Users = GetUsers();
        $Addresses = GetAddresses();
        $Categories = GetCategories();
        $ConnectMeth = GetConnectMeths();
        
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="Main.css" />
<title>Contents of All Database Tables</title>
</head>
<body>
<!-- This page is used to Show ALL database tables SIMULTANEOUSLY!!! -->
<table border="1">
                        <tr>
                                <th>Actions</th>
                                <th>FirstName</th>
                                <th>LastName</th>
                                <th>Password</th>
                        </tr>
       
        <? while($rs1 = $Users->fetch_assoc()){ ?>
                <tr>
                        <td>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/UserManagement/View.php?ID=<?=$rs1['ID']?>">View</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/UserManagement/EditUser.php?ID=<?=$rs1['ID']?>">Edit</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/UserManagement/Delete.php?ID=<?=$rs1['ID']?>">Delete</a>
                               
                        </td>
                        <td><?=$rs1['First_Name']?></td>
                        <td><?=$rs1['Last_Name']?></td>
                        <td><?=$rs1['Password']?></td>
                </tr>  
       
        <? } ?>
       
</table>
<a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/UserManagement/EditUser.php">Click here to add a new user.</p>
<br />
<table border="1">
                        <tr>
                                <th>Actions</th>
                                <th>Category ID</th>
                                <th>Person ID</th>
                                <th>Address Line 1</th>
                                <th>Address Line 2</th>
                                <th>City</th>
                                <th>State</th>
                                <th>Zipcode</th>
                                <th>Country</th>
                        </tr>
       
        <? while($rs2 = $Addresses->fetch_assoc()){ ?>
                <tr>
                        <td>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/AddressMgmt/View.php?ID=<?=$rs2['ID']?>">View</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/AddressMgmt/EditAddress.php?ID=<?=$rs2['ID']?>">Edit</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/AddressMgmt/Delete.php?ID=<?=$rs2['ID']?>">Delete</a>
                               
                        </td>
                        <td><?=$rs2['Category_ID']?></td>
                        <td><?=$rs2['Person_ID']?></td>
                        <td><?=$rs2['Address_Line1']?></td>
                        <td><?=$rs2['Address_Line2']?></td>
                        <td><?=$rs2['City']?></td>
                        <td><?=$rs2['State']?></td>
                        <td><?=$rs2['Zipcode']?></td>
                        <td><?=$rs2['Country']?></td>
                        
                </tr>  
       
        <? } ?>
       
</table>
<a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/AddressMgmt/EditAddress.php">Click here to add a new address.</a>
<br />
<!--  This is the categories table display area -->
<table border="1">
                        <tr>
                                <th>Actions</th>
                                <th>Category Name</th>
                               
                        </tr>
       
        <? while($rs3 = $Categories->fetch_assoc()){ ?>
                <tr>
                        <td>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/CategoriesMgmt/View.php?ID=<?=$rs3['ID']?>">View</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/CategoriesMgmt/EditCategory.php?ID=<?=$rs3['ID']?>">Edit</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/CategoriesMgmt/Delete.php?ID=<?=$rs3['ID']?>">Delete</a>
                               
                        </td>
                        <td><?=$rs3['Name']?></td>
                        
                </tr>  
       
        <? } ?>
       
</table>
<a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/CategoriesMgmt/EditCategory.php"><b>Click here to add a new category.</b></a>
<br />
<!--  This is the connection methods table display area -->
<table border="1">
                        <tr>
                                <th>Actions</th>
                                <th>Person ID</th>
                                <th>Category ID</th>
                                <th>Connection Value</th>
                        </tr>
       
        <? while($rs4 = $ConnectMeth->fetch_assoc()){ ?>
                <tr>
                        <td>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/ConnectMethMgmt/View.php?ID=<?=$rs4['ID']?>">View</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/ConnectMethMgmt/EditConnectMeth.php?ID=<?=$rs4['ID']?>">Edit</a>
                                <a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/ConnectMethMgmt/Delete.php?ID=<?=$rs4['ID']?>">Delete</a>
                               
                        </td>
                        <td><?=$rs4['Person_ID']?></td>
                        <td><?=$rs4['Category_ID']?></td>
                        <td><?=$rs4['Value']?></td>
                </tr>  
       
        <? } ?>
</table>
<a href="http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/ConnectMethMgmt/EditConnectMeth.php"><b>Click here to add a new Connection Method.</b></a>

</body>
</html>